package leetcodecompetition.S114AC;

import org.junit.jupiter.api.Test;

/**
 * @Author: Siantar
 * @Date: 2023-09-30-22:55
 * @Description: 1.0
 */
public class T100019 {
    public int maxSubarrays(int[] nums) {
        int andRes=nums[0],res=0,n=nums.length;
        for (int i = 0; i < n; i++) {
            andRes=(andRes&nums[i]);
            if (andRes==0){
                res++;
                if (i!=n-1){
                    andRes=nums[i+1];
                }
            }
        }
        return Math.max(res,1);
    }
    @Test
    public void test() {
        System.out.println(maxSubarrays(new int[]{0,8,0,0,0,23}));
    }
}
